Using R to Empower a Precision Dosing Web Application

Gergely Daróczi

@daroczig

dummy slide

> whoami()

> whoami()

> whoami()

> whoami()

> whoami()

> whoami()

> whoarewe()

> demo()

> demo()

> demo()

> demo()

> demo()

> demo()

> demo()

> demo()

> demo()

> Sys.setenv(“env” = “prod”)

> example(production)

  • 2006: calling R scripts from PHP (both reading from MySQL) to generate custom plots embedded in a homepage
  • 2008: automated/batch R scripts to generate thousands of pages of crosstables, ANOVA and plots from SPSS with pdflatex
  • 2011: Ruby on Rails web application calling RApache and pandoc to generate reports in plain English (NoSQL databases, vertical scaling, security, central error tracking etc)
  • 2012: plain RApache web application for NLP and network analysis
  • 2015: standardizing the data infrastructure of a fintech startup to use R both in bath jobs and stream processing (ETL, reporting, fraud detection, daily operations, customer communication etc)
  • 2017: redesign, monitor and scale the DS infrastructure of an adtech startup for batch training and live scoring

> production <<- list(…)

Using in R in a non-interactive way:

  • R scripts are scheduled to run without manual intervention (eg CRON or upstream job trigger, API request)
  • need for a standard, eg containerized environment (eg R and package versions, OS packages, .Rprofile etc)
  • security! (safeguarded production environment, SQL injection, AppArmor, encrypted credentials etc)
  • the output of the jobs are recorded and monitored (eg error handler for ErrBit, CloudWatch logs or Splunk etc), alerts and notifications
  • if an error occurs, usually there is no other way to figure out what happened then looking at the recorded job output, so better log than sorry

> is.compliant()

TODO

> Sys.setlocale(‘LC_ALL’, ‘hu_HU’)

Source: When my co-worker wants to simplify code …

TODO